package com.tanhua.dubbo.api.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.api.DimensionsApi;
import com.tanhua.dubbo.mapper.DimensionsMapper;
import com.tanhua.dubbo.pojo.Dimensions;
import com.tanhua.dubbo.pojo.Option;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService(version = "1.0.0")
public class DimensionsImpl implements DimensionsApi {
    @Autowired
    private DimensionsMapper dimensionsMapper;
    @Override
    public Dimensions queryById(Long id) {
        return this.dimensionsMapper.selectById(id);
    }

    @Override
    public Dimensions queryByReportId(Long reportId) {
        QueryWrapper<Dimensions> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("report_id",reportId);
        return this.dimensionsMapper.selectOne(queryWrapper);
    }

}
